package com.luych.toolbox.common.feign.view.data.service;

import com.luych.toolbox.common.enums.DataUpgradeStatus;
import com.luych.toolbox.common.feign.FeignView;
import com.luych.toolbox.common.feign.view.base.service.UserView;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

@ApiModel("数据升级")
public class DataUpgradeDetailView extends FeignView {

    @ApiModelProperty("数据项目")
    private DataProjectView dataProject;
    @ApiModelProperty("数据源")
    private DataSourceView dataSource;
    @ApiModelProperty("数据代理")
    private DataAgentView dataAgent;
    @ApiModelProperty("脚本")
    private String script;
    @ApiModelProperty("状态")
    private DataUpgradeStatus status;
    @ApiModelProperty("责任人")
    private UserView owner;
    @ApiModelProperty("开始时间")
    private Date startDate;
    @ApiModelProperty("结束时间")
    private Date completeDate;
    @ApiModelProperty("异常信息")
    private String errorMessage;
    @ApiModelProperty("异常堆栈")
    private String errorTrace;

    public DataProjectView getDataProject() {
        return dataProject;
    }

    public String getDataProjectId() {
        return dataProject == null ? null : dataProject.getId();
    }

    public void setDataProject(DataProjectView dataProject) {
        this.dataProject = dataProject;
    }

    public DataSourceView getDataSource() {
        return dataSource;
    }

    public String getDataSourceId() {
        return dataSource == null ? null : dataSource.getId();
    }

    public void setDataSource(DataSourceView dataSource) {
        this.dataSource = dataSource;
    }

    public DataAgentView getDataAgent() {
        return dataAgent;
    }

    public String getDataAgentId() {
        return dataAgent == null ? null : dataAgent.getId();
    }

    public void setDataAgent(DataAgentView dataAgent) {
        this.dataAgent = dataAgent;
    }

    public String getScript() {
        return script;
    }

    public void setScript(String script) {
        this.script = script;
    }

    public DataUpgradeStatus getStatus() {
        return status;
    }

    public void setStatus(DataUpgradeStatus status) {
        this.status = status;
    }

    public String getStatusValue() {
        return status == null ? null : status.getValue();
    }

    public UserView getOwner() {
        return owner;
    }

    public void setOwner(UserView owner) {
        this.owner = owner;
    }

    public String getOwnerId() {
        return owner == null ? null : owner.getId();
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getCompleteDate() {
        return completeDate;
    }

    public void setCompleteDate(Date completeDate) {
        this.completeDate = completeDate;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public String getErrorTrace() {
        return errorTrace;
    }

    public void setErrorTrace(String errorTrace) {
        this.errorTrace = errorTrace;
    }
}
